package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.ListBean;
import com.cskaoyan.bean.UserBean;
import com.cskaoyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/user/list")
    public BaseRespVo list(String username,String mobile,Integer page,Integer limit,String sort,String order){
        ListBean listBean = userService.queryUserListBean(username,mobile,page,limit,sort,order);
        return BaseRespVo.ok(listBean);
    }

    @RequestMapping("collect/list")
    public BaseRespVo collect(Integer page, Integer limit, Integer userId, Integer valueId, String sort, String order){
        ListBean listBean = userService.queryUserCollectListBean(page,limit,userId,valueId,sort,order);
        return BaseRespVo.ok(listBean);
    }

    @RequestMapping("footprint/list")
    public BaseRespVo footprint(Integer page, Integer limit,Integer userId,Integer goodsId,String sort, String order ){
        ListBean listBean = userService.queryUserFootprintListBean(page,limit,userId,goodsId,sort,order);
        return BaseRespVo.ok(listBean);
    }

    @RequestMapping("history/list")
    public BaseRespVo footprint(Integer page, Integer limit,Integer userId,String keyword,String  sort, String order ){
        ListBean listBean = userService.queryUserHistoryListBean(page,limit,userId,keyword,sort,order);
        return BaseRespVo.ok(listBean);
    }

    @RequestMapping("feedback/list")
    public BaseRespVo footprint(Integer page, Integer limit,String username,String  sort, String order,Integer id){
        ListBean listBean = userService.queryUserFeedbackListBean(page,limit,username,sort,order,id);
        return BaseRespVo.ok(listBean);
    }





}
